Repository navigation
Fix #1307: reset config.theme to default + document composer install on v2.0 upgrade - #1317
Conversation
…on v2.0 upgrade v2.0 ships a complete chrome rewrite (#1123 / #1207 / #1259 / #1275). Operators upgrading from v1.x hit two real-world UX gaps the dev stack doesn't catch (it always starts fresh on `default` and always has a populated `vendor/`): 1. `config.theme` carries the v1.x fork's directory name out of the updater. The updater wizard itself runs against `default` (the `IS_UPDATE` override in `init.php`), but that scoping ends when the operator clicks "Return to panel" and the next request reads the stale fork value. The v2.0 default theme has new typed View DTOs, a new admin sidebar partial, and rewritten template signatures the v1.x fork literally does not contain — best case Smarty fatals, worst case it half-renders against undefined variables. 2. `vendor/` is present but stale on git-based upgrades. v2.0 added symfony/mailer, league/commonmark, and major-bumped lcobucci/jwt and Smarty. `init.php`'s autoload check only verifies the file exists, not that it's v2.0-shaped — so upgraded panels pass bootstrap and 500 mid-render with the actual class-not-found line buried in the PHP error log. Half 1: paired updater migration `web/updater/data/808.php` rewrites `config.theme` back to `default` for any install not already on the shipped theme. Idempotent (the WHERE clause excludes the already-set row), safe to re-run, and the default value matches the seed in `install/includes/sql/data.sql` so fresh and upgraded installs converge. Operators with a fork re-select it from Admin → Settings → Themes once they've ported it (per #1115). Half 2: documents the `composer install` prerequisite in UPGRADING.md above the existing telemetry section, plus a new "Theme compatibility" section that surfaces the half-1 reset to operators reading docs ahead of the upgrade. README.md gains a one-line cross-reference at the head of the master-branch install instructions so admins reading those instructions don't miss UPGRADING.md. Regression coverage: `web/tests/integration/UpgradeThemeResetTest.php` exercises four properties — fork value rewritten, default value left untouched, re-run is a no-op, and migration's default matches the data.sql seed.
|
Post-merge adversarial review (PR was already merged when I ran). One real finding plus a sweep of the rest. What checks out
Finding: doc inaccuracy in
|
Fixes #1307.
Summary
v2.0 ships a complete chrome rewrite (#1123 / #1207 / #1259 / #1275).
Operators upgrading from v1.x hit two real-world UX gaps the dev stack
doesn't catch (it always starts fresh on
defaultand always has apopulated
vendor/). Both halves land here:web/updater/data/808.php:rewrites
:prefix_settings.config.themeback todefaultfor anyinstall not already on the shipped theme. The updater wizard itself
runs against
default(IS_UPDATEoverride ininit.php), butthat scoping ends when the operator clicks "Return to panel" — the
next request reads the stale fork value and Smarty fatals against
v2.0 templates the v1.x fork doesn't contain. Idempotent (the
WHERE clause excludes the already-set row), safe to re-run, and
the default value matches the seed in
install/includes/sql/data.sqlso fresh and upgraded installsconverge. Operators with a fork re-select it from Admin →
Settings → Themes once they've ported it (per Author UPGRADING.md for 1.x to 2.0 #1115).
composer installprerequisite documented:UPGRADING.mdgains a new "PHP dependencies" section above theexisting telemetry one, plus a "Theme compatibility" section that
surfaces half 1 for docs-first readers.
README.mdgets aone-line cross-reference at the head of the master-branch install
instructions so admins reading those don't miss
UPGRADING.md.v2.0's autoload check only verifies
vendor/autoload.phpexists,not that it's v2.0-shaped — so panels with a stale v1.x
vendor/pass bootstrap and 500 mid-render with the actual class-not-found
line buried in the PHP error log.
Per
AGENTS.md"Updater migrations": idempotent UPDATE,:prefix_placeholder,
// @phpstan-ignore variable.undefinedon each$this->dbscall, defaults converge withdata.sql, registered instore.json. Per "Keep the docs in sync":UPGRADING.mdis theload-bearing operator surface for upgrade-day defects, so the docs
land in the same PR as the migration.
Test plan
./sbpp.sh phpstan→ no errors (no new violations introduced)../sbpp.sh test --filter=UpgradeThemeReset→ 4/4 pass:testForkThemeIsResetToDefault— fork value rewritten on first run.testInstallAlreadyOnDefaultIsUntouched— WHERE clause excludesthe already-set row.
testRerunImmediatelyAfterFirstPassIsNoOp— second run matcheszero rows (idempotency guarantee).
testMigrationDefaultMatchesDataSqlSeed— the migration's'default'literal matchesdata.sql's('config.theme', 'default')seed; future renames of the shipped theme directorywon't silently diverge fresh and upgraded installs.
./sbpp.sh test(full suite) → 407 tests, 1778 assertions, all OK.ts-check/composer api-contract/e2eweren't run because thisPR doesn't touch
web/scripts/,web/themes/*/js/,web/api/handlers/,or any user-facing UI surface.